import Vue from 'vue'
import VueRouter from 'vue-router'

import Layout from '@/views/Layout'
import Login from '@/views/Login'

import Question from '@/views/Question'
import Video from '@/views/Video'
import Article from '@/views/Article'
import User from '@/views/User'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    component: Layout,
    children: [
      { path: '/article', component: Article },
      { path: '/question', component: Question },
      { path: '/video', component: Video },
      { path: '/user', component: User }
    ]
  },
  { path: '/login', component: Login }

]

const router = new VueRouter({
  routes
})

export default router
